package io.wins.vertx.core;

import io.vertx.ext.web.Router;

public final class SingletonRouter {
    private static Router router;
    private static SingletonRouter instance;

    public static SingletonRouter getInstance() {
        if (instance == null) {
            instance = new SingletonRouter();
        }
        return instance;
    }

    private SingletonRouter() {
        router = Router.router(SingletonVertx.getVertx());
    }

    public Router getRouter() {
        if (instance == null) {
            instance = new SingletonRouter();
        }
        return router;
    }
}
